main() {
  var pair = [
    [1, 2],
    [3, 4]
  ];
  print(
      'flatten list: ${pair.expand((pair) => pair).toList()}'); //输出: flatten list: [1, 2, 3, 4]
  var inputs = [1, 2, 3];
  print('duplicated list: ${inputs.expand((number) => [
        number,
        number,
        number
      ]).toList()}'); //输出: duplicated list: [1, 1, 1, 2, 2, 2, 3, 3, 3]
}
